<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*,java.text.*,com.java.entity.*"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<table border="1" cellspacing="0">
		<tr>
			<td>学号</td>
			<td>姓名</td>
			<td>出生日期</td>
			<td>性别</td>
			<td>身份证号</td>
			<td>电话</td>
		</tr>
		<%
			List<Student> list = (List<Student>) request.getAttribute("StudentServlet");
			int xh = 0;
			for (int i = 0; i < list.size(); i++) {
				Student u = list.get(i);
				xh = i + 1;
		%>
		<%
			if (xh % 2 == 1) {
		%>
		<tr style="background-color: yellow;">
			<td><%=xh%></td>
			<td><%=u.getName()%></td>
			<td><%=u.getBirthday()%></td>
			<td><%=u.getSex()%></td>
			<td><%=u.getSfzh()%></td>
			<td><%=u.getPhone()%></td>
		</tr>
		<%
			} else {
		%>
		<tr>
			<td><%=xh%></td>
			<td><%=u.getName()%></td>
			<td><%=u.getBirthday()%></td>
			<td><%=u.getSex()%></td>
			<td><%=u.getSfzh()%></td>
			<td><%=u.getPhone()%></td>
		</tr>
		<%
			}
			}
		%>
	</table>
</body>
</html>